using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using Medora.Model.Basic;

namespace Medora.Model.Persons
{
    public class Person : DeletedEntity
    {
        public string Idnp { get; set; }

        public string FirstName { get; set; }

        public string LastName { get; set; }

        public string Surname { get; set; }

        [IgnoreDataMember]
        public string FullName
        {
            get
            {
                return string.Format("{0} {1}", LastName, FirstName);
            }
        }

        public DateTime? DateBirth { get; set; }

        public DateTime? DateDeath { get; set; }

        public int Sex { get; set; }

        [ObjectRequired(ErrorMessage = "Department is required")]
        public Guid AddressId { get; set; }
        public virtual Address Address { get; set; }

        [IgnoreDataMember]
        public string AddressShort
        {
            get
            {
                if (Address != null)
                {
                    return string.Format("{0} {1}{2}", Address.Street, Address.House, string.IsNullOrEmpty(Address.Appartment) ? "" : string.Format(", ap. {0}", Address.Appartment));
                }
                return "";
            }
        }

        //todo full address
        [IgnoreDataMember]
        public string AddressFull
        {
            get
            {
                if (Address != null)
                {
                    return string.Format("{0} {1}{2}", Address.Street, Address.House, string.IsNullOrEmpty(Address.Appartment) ? "" : string.Format(", ap. {0}", Address.Appartment));
                }
                return "";
            }
        }

        public string Phone { get; set; }

        public string MobilePhone { get; set; }

        public string Email { get; set; }

        public virtual ICollection<Allergy> Allergies { get; set; } 
        public virtual ICollection<BadHabits> BadHabitses { get; set; } 
        public virtual ICollection<FamilyHistory> FamilyHistories { get; set; }
        public virtual ICollection<Medication> Medications { get; set; }
        public virtual ICollection<HeightWeightMeasurement> HeightWeightMeasurements { get; set; }
        public virtual ICollection<BloodPressureMeasurement> BloodPressureMeasurements { get; set; }

        
      /*  private int fMaritalStatusID;
        private int fCitizenshipID;
        private int fChildrensCount;
        private int fCategoryOfNHICID;
        private int fBloodGroupID;
        private Guid fCommonHealthInfoGUID;
        private bool fAttached;
        private bool fSchoolChildren;
        private string fOrganizationName;
        private string fProfession;
        private DateTime fPensionerDate;
        private Guid fFamilyDoctorGUID;
        private string fFamilyDoctorName;
        private Guid fPersonMainGUID;
        private int fInstitutionLinkID;
        private string fPoliceN;
        private int fSocialStatusID;
        private string fComments;
        private int fFreeField1;
        private int fFreeField2;
        private Guid fSectorGUID;
        private int fTypeOfIndustry;
        private DateTime fRegistrationInNHICDate;
        private string fExists;// exists= if exist info defined date ;not exists=if not exist info defined date
        private string fStatus;//s=Select; e=Edit;n=New;
       */
        
    }
}